<?php

namespace app\admin\controller;


use app\BaseController;

use think\facade\View;

class Login extends BaseController
{
    //控制器初始化方法
    public function initialize()
    {
        parent::initialize();
        View::assign('title', '后台登录');
        
        $this->admin = new \app\admin\model\logic\Admin();
        $this->role = app('app\admin\model\db\AdminRole');
    }
    public function index()
    {
        return view::fetch();
    }

    public function login(){
        $rs_st=$this->admin->admin_login();
        return $rs_st;
    }

    public function out(){
        model('logic.admin_log')->record_log();
        cookie("adminid", NULL);
        cookie("shop_id", NULL);
        $this->redirect("login/index");
    }
}
